﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Data;
using ESOL.Common.Entity;

namespace ESOL.Services
{
    [ServiceContract]
    public interface IMstService
    {
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool TestConnect();

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetMstCItemByType(string itemType);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MstCommonItemEntity> GetMstCItemListByType(string itemType);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        MstProductEntity GetProductByKey(string id);

        /// <summary>
        /// 获取大类
        /// </summary>
        /// <param name="BroadClassName"></param>
        /// <param name="BroadClassCode"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetBroadClass(string BroadClassName, string BroadClassCode);

        /// <summary>
        /// 获取中类
        /// </summary>
        /// <param name="BroadClassName"></param>
        /// <param name="BroadClassCode"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetMiddleClass(List<string> ListIn);

        /// <summary>
        /// 获取小类
        /// </summary>
        /// <param name="BroadClassName"></param>
        /// <param name="BroadClassCode"></param>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetType(List<string> ListIn);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetStd(List<string> ListIn);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetMaterial(List<string> ListIn);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetProduct(List<string> ListIn);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetRemark(List<string> ListIn);

        //物料
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool IsExistProduct(string productCode);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        MaterialInfoPageResult GetProductAllDsByCondition(ProductQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MstProductEntity> GetMstMaterialAllListByTypeId(string typeId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool InsertMstMaterial(MstProductEntity material);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateMstMaterial(MstProductEntity material);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateMstMaterialDto(MaterialInfo materialDto);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelMstMaterial(MstProductEntity material);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelMstMaterialDto(MaterialInfo materialDto);

        //CodeRule
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetCodeRuleAllDsByCondition(CodeRuleQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MstCodeRuleEntity> GetCodeRuleAllList();

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool AddCodeRule(MstCodeRuleEntity codeRule);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateCodeRule(MstCodeRuleEntity codeRule);

        //CommonItem
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetCommonItemAllDsByCondition(CommonItemQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MstCommonItemEntity> GetCommonItemAllList();

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MstCommonItemEntity> GetCommonItemAllListByType(string type);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool AddCommonItem(MstCommonItemEntity cmItem);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateCommonItem(MstCommonItemEntity cmItem);

        //客户
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool IsExistCustomer(string customerNo);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateCustomer(MstCustomerEntity customer);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveCustomer(CustomerSaveParam param);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelCustomer(MstCustomerEntity customer);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        MstCustomerEntity GetCustomerByKey(string id);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        CustomerPageResult GetCustomerAllListByCondition(CustomerQueryCondition con);

        //客户联系人
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MstCustomerContactEntity> GetCustomerContactAllListByCustomerId(string customerId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MstCustomerContactEntity> GetCustomerContactAllListByCondition(CustomerContactQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelCustomerContact(MstCustomerContactEntity contact);

        //客户业务员
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MstCustomerSalesmanEntity> GetCustomerSalesmanAllListByCustomerId(string customerId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelCustomerSalesman(MstCustomerSalesmanEntity salesman);

        //Area 省、市
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MstAreaEntity> GetAllProvince();

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MstAreaEntity> GetAreaAllListByCondition(AreaQueryCondition param);

        //生产范围
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        MstIndustryTypeEntity GetMstIndustryTypeByKey(string typeCode);

        //产品大类
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        MstProductTypeEntity GetMstProductTypeByKey(string typeId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MstProductTypeEntity> GetMstProductParentType();

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MaterialTypeResult> GetMstMaterialTypeAllListByConditon(MaterialTypeQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveMstProductType(MstProductTypeEntity productType);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelMstProductType(MstProductTypeEntity productType);

        //根据物料ID，查询物料及类型信息
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        MaterialInfo GetMstMaterialInfoByKey(string id);

        //供应商产品范围
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<SupplierProductScopeDto> GetSupplierScopeDtoAllList();

        //物料保存
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveMstMaterial(MaterialSaveParam param);

        //查询物料历史价格
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MaterialPriceDto> GetMstMaterialPriceDtoAllListByMaterialId(string materialId);

        //根据用户，查询其工作日历的任务
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<MstScheduleEntity> GetMstScheduleByConditon(MstScheduleQueryCondition param);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveMstSchedule(MstScheduleSaveParam param);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        HmDomainsEntity GetHmDomain();

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        HmAccountsEntity GetHmAccountByAdd(string mailAdd);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveHmMailUser(HmAccountsEntity account);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        MstMailserverConfigEntity GetMstMailserverCfg();

        //主物料信息
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        MstMaterialExDto GetMstMaterialExDtoByMaterialId(string materialId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        MstMaterialExEntity GetMstMaterialExByMaterialId(string materialId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        MstMaterialExPageResult GetMstMaterialExAllListByCondition(MaterialExQueryCondition con);

        //主物料保存
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveMstMaterialEx(MstMaterialExEntity materialEx);

        //主物料删除
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelMstMaterialExDto(MstMaterialExDto materialExDto);


        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveCodeRule(CodeRuleSaveParam param);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        string CreateCodeRule(CodeRuleQueryCondition param);

        //获取最新单据编码
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        string GetCurrentOrderCode(string codeType);


        //签名档
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        MstSignDtoPageResult GetMstSignDtoPageResult(MstSignDtoQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveMstSignDto(MstSignDto signDto);

         [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelMstSignDto(MstSignDto signDto);

         [OperationContract]
         [FaultContract(typeof(ProcessExecutionFault))]
         MstSignEntity GetMstSignByUserNo(string userNo);

    }
}
